﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Arizu.Repository;
using System.Data;

namespace AiRiZu.User
{
    public partial class Payout_pf : Common
    {
        public string ALIPAYID { get; set; }
        public string PAYPALID { get; set; }
        public string TENPAYID { get; set; }

        public string Bank { get; set; }
        public string BankAccount { get; set; }
        public string AccountName { get; set; }

        public int Type = -1;

        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["logId"] == null)
            {
                return;
            }

            AirizuPayout airizuPayout = AirizuPayout.CreateInstance();

            DataTable dt = airizuPayout.GetPayoutInfo(int.Parse(Session["logId"].ToString()));

            if (dt.Rows.Count > 0)
            {
                Type = int.Parse(dt.Rows[0]["Type"].ToString());

                switch (Type)
                {
                    case (int)PayoutType.ALIPAY:
                        ALIPAYID = dt.Rows[0]["AccountID"].ToString();
                        break;
                    case (int)PayoutType.PAYPAL:
                        PAYPALID = dt.Rows[0]["AccountID"].ToString();
                        break;
                    case (int)PayoutType.TENPAY:
                        TENPAYID = dt.Rows[0]["AccountID"].ToString();
                        break;
                    case (int)PayoutType.BANK:
                        Bank = dt.Rows[0]["BankAccountSite"].ToString();
                        BankAccount = dt.Rows[0]["BankAccountNum"].ToString();
                        AccountName = dt.Rows[0]["BankAccountName"].ToString();
                        break;
                    default:
                        break;
                }
            }
        }
    }
}
